package API.DAY8.thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        System.out.println("请输入一个整数:");
        Scanner sc = new Scanner(System.in);
        for(int i = sc.nextInt();i>0;i--){
            try {
                System.out.println(i);
                Thread.sleep(1000);
//            Scanner sc = new Scanner(System.in);
//            System.out.println("请输入一个整数:");
//            int n = sc.nextInt();
//            for(int i=0;i<n;i++){
//                System.out.println(n-i);
//                Thread.sleep(1000);
//            }

            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

        System.out.println("时间到");
    }
}
